﻿// Copyright (c) Inossem. All rights reserved.
// Licensed under the LGPL-3.0 license. See LICENSE file in the project root for full license information.
using DWF.Studio.RemoteCtrls.Models;
using DWF.Studio.Share.Log;
using System;
using System.Activities;
using System.Activities.Presentation;
using System.Activities.Presentation.Model;
using System.Activities.Presentation.Services;
using System.Activities.Presentation.View;
using System.Activities.Statements;
using System.Activities.XamlIntegration;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Xml.Linq;
using System.IO;
using System.Xml;
using System.Activities.Presentation.ViewState;
using System.AddIn.Contract;
using System.AddIn.Pipeline;
using DWF.Studio.RemoteCtrls.SearchExporer;

namespace DWF.Studio.RemoteCtrls.Proxy
{
    public class SearchExplorerProxy : MarshalByRefProxyBase
    {
        /// <summary>
        /// 选中活动
        /// </summary>
        public Action<ShowSearchActivityEventArgs> _selectionChanged = null;

        private UCtrlSearchExporer wfSearchExplorer = null;
        public SearchExplorerProxy()
        {
            wfSearchExplorer = new UCtrlSearchExporer();
        }

        public INativeHandleContract GetSearchExplorer()
        {
            wfSearchExplorer._selectionChanged += (e) => { _selectionChanged?.Invoke(new ShowSearchActivityEventArgs(e.FullName,e.IdRef,e.DisplayName)); };

            return FrameworkElementAdapters.ViewToContractAdapter(wfSearchExplorer);
        }
        public void ShowSearchBox(List<string> listFile,double windowWidth)
        {
            wfSearchExplorer.ShowSearchBox(listFile, windowWidth);
        }
    }
}
